#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:production.py
# author:邹煜扬
# datetime:2024/12/17 17:23
# software: PyCharm
"""
产生式的数据结构的定义
"""
# import module your need

class Production:
    def __init__(self, left, right):
        self.left = left
        self.right = right

    def __eq__(self, other):
        return self.left == other.left and self.right == other.right
    def __hash__(self):
        return hash((self.left, self.right))

    def __iter__(self):
        return iter((self.left, self.right))

    def __str__(self):
        return f"{self.left} -> {self.right}"#打印产生式，左部->右部
